package com.example.selfcontrol.service.impl;

import com.example.selfcontrol.config.Response;
import com.example.selfcontrol.entity.StudentStuff;
import com.example.selfcontrol.mapper.StudentStuffMapper;
import com.example.selfcontrol.service.StudentStuffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentStuffServiceImpl implements StudentStuffService {
    @Autowired
    private StudentStuffMapper studentStuffMapper ;

    @Override
    public Response JudgeUserStuff(Long userId, String picture, String code) {
        StudentStuff studentStuff = new StudentStuff(userId,picture,code) ;
        try {
            studentStuffMapper.insert(studentStuff) ;
        }catch (Exception e) {return Response.fail() ; }
        return Response.ok() ;
    }
}
